{
  Simple Stepper Motor Test
  Written by: Daniel Harris
  Parallax Inc.
  10-28-2010

  
  There is no software licensing on this file.  Completely available for distrobution and use!  :)
}
CON

  _clkmode = xtal1 + pll16x
  _clkfreq = 80_000_000

  'Phase Pin Assignments
  phaseA        = 7
  phaseB        = 6
  phaseC        = 5
  phaseD        = 4
  


pub go


  'set the stepper motor control pins to outputs
  dira[phaseA]~~
  dira[phaseB]~~
  dira[phaseC]~~
  dira[phaseD]~~
  
  
  repeat  'repeat this block forever

    outa[phaseA]~~              'Phase A high
    outa[phaseB]~~              'Phase B high
    outa[phaseC]~               'Phase C low
    outa[phaseD]~               'Phase D low
    wait                        'wait for a length of time
    
    outa[phaseA]~
    outa[phaseB]~~
    outa[phaseC]~~
    outa[phaseD]~    
    wait
  
    outa[phaseA]~
    outa[phaseB]~
    outa[phaseC]~~
    outa[phaseD]~~    
    wait
    
    outa[phaseA]~~
    outa[phaseB]~
    outa[phaseC]~
    outa[phaseD]~~
    wait
        


pub wait

  waitcnt(cnt + clkfreq/100)    'pauses program execution for ~1/100th of a second (.01 seconds)